# - - parameters - - - - - - - - - - - 
#=
  Symanzik improved gauge actions debuged by
  https://link.springer.com/article/10.1140/epjc/s10052-017-5392-6
  Improved thermodynamics of SU(2) gauge theory Pietro Giudice & Stefano Piemonte 
=# 
# Physical setting 
system["L"] = (8, 8, 8, 8)
system["β"] = 1.6
system["NC"] = 2
system["Nthermalization"] = 0
system["Nsteps"] = 201
system["initial"] = "cold"
system["initialtrj"] = 1
system["update_method"] = "Heatbath"
system["useOR"] = false
system["numOR"] = 1
system["Nwing"] = 1
	
# Physical setting(fermions)
system["quench"] = true
system["Dirac_operator"] = nothing
system["BoundaryCondition"] = [1, 1, 1, -1]
	
# System Control
system["log_dir"] = "./logs"
system["logfile"] = "Heatbath_L08080808_beta1.6_quenched.txt"
system["saveU_dir"] = ""
system["saveU_format"] = nothing
system["verboselevel"] = 2
system["randomseed"] = 111
measurement["measurement_basedir"] = "./measurements"
measurement["measurement_dir"] = "Heatbath_L08080808_beta1.6_quenched"
	
# HMC related
	
# Action parameter for SLMC
actions["use_autogeneratedstaples"] = false
actions["couplingcoeff"] = Any[]
actions["couplinglist"] = Any[]
	
# Measurement set
measurement["measurement_methods"] = Dict[ 
  Dict{Any,Any}("methodname" => "Polyakov_loop",
    "measure_every" => 1
  ),
  Dict{Any,Any}("methodname" => "Plaquette",
    "measure_every" => 1
  )
]
	
# - - - - - - - - - - - - - - - - - - -

#-(\beta/2) Re Tr((5/3) plaquette - (1/12) r
beta = 1.6
actions["use_autogeneratedstaples"] = true
actions["couplingcoeff"] = [beta*5/3,-beta/12]
#actions["couplinglist"] = ["plaq","rect","polyx"]

#=
function makeplaq()
    loopset = []
    for μ=1:4
        for ν=μ:4
            if ν == μ
                continue
            end
            push!(loopset,[(μ,1),(ν,1),(μ,-1),(ν,-1)])
        end
    end
    return loopset
end

function makechair()
    loopset = []
    set1 = (1,2,3)
    set2 = (1,2,4)
    set3 = (2,3,4)
    set4 = (1,3,4)

    for set in (set1,set2,set3,set4)
        mu,nu,rho = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        mu,rho,nu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        nu,rho,mu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        nu,mu,rho = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        rho,mu,nu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

        rho,nu,mu = set
        loop = [(mu,1),(nu,1),(rho,1),(mu,-1),(rho,-1),(nu,-1)]
        push!(loopset,loop)

    end
    return loopset
end
=#

plaqloops = make_plaqloops()
rectloops = make_rectloops(2)

#=
chairloops = makechair()
L = system["L"]
poly1loops = make_polyakovloops(1,L[1])
poly2loops = make_polyakovloops(2,L[2])
poly3loops = make_polyakovloops(3,L[3])
poly4loops = make_polyakovloops(4,L[4])

=#

actions["coupling_loops"] = [plaqloops,rectloops]


